package com.wait;

public class BreadBox {
	private Bread bread;
	
	public synchronized void put(Bread bread){
		try {
			wait();  //等待
		} catch (InterruptedException e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
		
		this.bread=bread;
		notifyAll();
	}
	
	public synchronized Bread get(){
		
		
		
		return bread;
	}
}
